#include <vector>
#include <algorithm>
#include <utility>
#include <iostream>
using namespace std;

void outputPairVector(vector<pair<int, int>> &vec) {
    int size = vec.size();
    for (int i = 0; i < size; ++i) {
        cout << "(" << vec[i].first << ", " << vec[i].second << ") ";
    }
}

void getMinHost(vector<pair<int, int>> &vec) {
    int size = vec.size();
    int startIndex = 0, endIndex = 0;
    int result = 1;
    for (int i = 1; i < size; ++i) {
        if (vec[i].first < vec[endIndex].second) {
            result += 1;
        } else {
            result = max(result, endIndex - i);
            endIndex += 1;
        }
    }
    cout << result << endl;
}

int main() {
    vector<pair<int, int>> input;
    input.emplace_back(1, 5);
    input.emplace_back(6, 7);
    input.emplace_back(3, 4);
    input.emplace_back(3, 6);
    input.emplace_back(5, 7);
    input.emplace_back(6, 9);
    input.emplace_back(2, 9);
    input.emplace_back(10, 15);
    input.emplace_back(1, 2);
    outputPairVector(input);
    sort(input.begin(), input.end(), [](const pair<int, int> &a, const pair<int, int> &b) {
        if (a.first == b.first)
            return a.second < b.second;
        else
            return a.first < b.first;
    });
    cout << endl;
    outputPairVector(input);
    cout << endl;
    getMinHost(input);
    return 0;
}
